﻿// <copyright file="MainPage.xaml.cs" company="Microsoft Corporation">
// Copyright (c) 2011 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2011-02-02</date>
// <summary>MainPage code behind</summary>

namespace MSAF_OOB
{
    using System;
    using System.Windows.Controls;
    using System.Windows.Media.Imaging;

    /// <summary>
    /// MainPage code behind
    /// </summary>
    public partial class MainPage : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the MainPage class
        /// </summary>
        public MainPage()
        {
            // Required to initialize variables
            InitializeComponent();
        }

        /// <summary>
        /// Get an image from Bing
        /// </summary>
        /// <param name="sender">the button</param>
        /// <param name="e">the routed event arguments</param>
        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var source = new BitmapImage(new Uri("http://ts2.mm.bing.net/images/thumbnail.aspx?q=228407969501&id=7ba13065a5d4d343d9dba65746f6bd30&url=http%3a%2f%2figuide.travel%2fthumbs%2fLake_Tekapo-1.jpg", UriKind.Absolute));

            this.Image.Source = source;
        }
    }
}